TableGetColByHeader Function

private function TableGetColByHeader(tab, id) result(col)

return elements of a column given the header

Arguments

Type IntentOptional Attributes Name
type(Table), intent(in) :: tab
character(len=*), intent(in) :: id

header id

Return Value type(Column)


Variables

Type Visibility Attributes Name Initial
logical, public :: found
integer, public :: i

Source Code

FUNCTION TableGetColByHeader &
!
( tab, id ) &
!
RESULT (col)

IMPLICIT NONE

!arguments with intent (in):
TYPE (table), INTENT (IN) :: tab
CHARACTER (LEN = *),  INTENT (IN) :: id !! header id

!local dclarations:
 TYPE (Column) :: col
 INTEGER :: i
 LOGICAL :: found
!--------------------------------end of declarations---------------------------
 
found = .FALSE.
 
DO i = 1, tab % noCols
    IF ( tab % col (i) % header == id ) THEN
        col = tab % col (i)
        found = .TRUE.
    END IF
END DO

RETURN

END FUNCTION TableGetColByHeader